package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsUserMapper;
import com.qf.mapper.StatMapper;
import com.qf.pojo.DtsUser;
import com.qf.service.DtsUserService;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version v1.0.0
 * @Description:
 * @author: 姜红凯
 * @date: 2022.02.21
 * @since 1.0
 */
@Service
public class DtsUserServiceImpl implements DtsUserService {

    @Autowired
    DtsUserMapper userMapper;

    @Autowired
    StatMapper statMapper;

    @Override
    public int queryTotal() {
        LambdaQueryWrapper<DtsUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsUser::getDeleted,false);

        Integer count = userMapper.selectCount(wrapper);
        return count;
    }

    @Override
    public List<DayStatis> findUserDayStatis(int day) {

        return statMapper.findUserDayStatis(day);
    }
}
